gjs includes an override to turn GSettings' asserts into exceptions,
but we'll have to catch that instead of checking for a null return
value.
Spotted by coverity in CID 351268.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>
// Create the new folder
let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/');
- let newFolderSettings = new Gio.Settings({
- schema_id: 'org.gnome.desktop.app-folders.folder',
- path: newFolderPath,
- });
- if (!newFolderSettings) {
+ let newFolderSettings;
+ try {
+ newFolderSettings = new Gio.Settings({
+ schema_id: 'org.gnome.desktop.app-folders.folder',
+ path: newFolderPath,
+ });
+ } catch (e) {
log('Error creating new folder');
return false;
}